package com.zecan.blog.dao.converter;


import com.zecan.blog.dto.comment.ReplyCommentDto;
import com.zecan.blog.entity.Comment;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @ClassName BlogCommentConverter
 * @Description
 * @date 2022/11/11 15:16
 * @Version 1.0
 */
@Mapper
public interface BlogCommentConverter {

    BlogCommentConverter INSTANCE = Mappers.getMapper(BlogCommentConverter.class);


    @Mappings({
            @Mapping(target = "commentArticleId", source = "commentArticleId"),
            @Mapping(target = "commentReplyAuthorId", source = "commentReplyAuthorId"),
            @Mapping(target = "commentParentId", source = "commentParentId"),
            @Mapping(target = "commentContent", source = "commentContent"),
            @Mapping(target = "commentNickname", source = "commentNickname"),
            @Mapping(target = "commentReplyNickname", source = "commentReplyNickname"),
            @Mapping(target = "commentAuthorId", source = "commentAuthorId"),
    })
    Comment commentConverterEntity(ReplyCommentDto replyCommentDto);

}
